#Which Compiler
CC = g++

#INCLUDES DIR
INCLUDE = /home/cpp/hdf5/include

#LIBS DIR
LIB = /home/cpp/hdf5/lib


all:test

test:test.o libdatafile.a
	$(CC) -o test test.o -L. -ldatafile -L$(LIB) -lhdf5 -lhdf5_hl -lz -lsz  -lnetcdf -lnetcdf_c++

test.o:test.cpp
	$(CC) -c test.cpp -I$(INCLUDE)

libdatafile.a:Fileobj.o DataObj.o
	ar crv libdatafile.a DataObj.o Fileobj.o
Fileobj.o:Fileobj.h Fileobj.cpp datafile.h
	$(CC) -c Fileobj.h Fileobj.cpp -I$(INCLUDE)
DataObj.o:DataObj.h DataObj.cpp datafile.h 
	$(CC) -c DataObj.h DataObj.cpp -I$(INCLUDE)


clean:
	-rm *.o
	-rm *.a
	-rm *.nc
	-rm *.h5
	-rm test
